package com.frame.easy.modular.sample.controller;

import com.frame.easy.base.controller.BaseController;
import com.frame.easy.modular.sample.model.SampleGeneral;
import com.frame.easy.modular.sample.service.SampleGeneralService;
import com.frame.easy.result.Tips;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 代码生成示例
 *
 * @author TengChong
 * @date 2019-04-09
 */
@Controller
@RequestMapping("/sample/general")
public class SampleDataController extends BaseController {

    /**
     * 代码生成示例 service
     */
    @Autowired
    private SampleGeneralService service;

    /**
     * 列表
     *
     * @param object 查询条件
     * @return Tips
     */
    @RequestMapping("select")
    @ResponseBody
    public Tips select(@RequestBody(required = false) SampleGeneral object) {
        logger.debug("/sample/general/select");
        return Tips.getSuccessTips(service.select(object));
    }
}
